package com.zmj.sy.mom.srv.aps.controller;

import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseIdReqVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseListResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.processchainitem.*;
import com.zmj.sy.mom.srv.aps.service.ProcessChainItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RequiredArgsConstructor
@Api(tags = "工序链明细")
@RestController
@RequestMapping("/processChainItem")
public class ProcessChainItemController {

    private final ProcessChainItemService processChainItemService;

    @ApiOperation("工序链列表")
    @GetMapping("/list")
    public BaseListResVo<ProcessChainItemListResVo> list(ProcessChainItemListReqVo reqVo){
        return processChainItemService.list(reqVo);
    }

    @ApiOperation("添加工序链")
    @PostMapping("/add")
    public BaseResVo add(@RequestBody ProcessChainItemAddReqVo reqVo){
        processChainItemService.add(reqVo);
        return BaseResVo.ok();
    }


    @ApiOperation("修改工序链")
    @PostMapping("/edit")
    public BaseResVo edit(@RequestBody ProcessChainItemEditReqVo reqVo){
        processChainItemService.edit(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("领料单 - 钢板移动位置")
    @PostMapping("/move")
    public BaseResVo move(@RequestBody ProcessChainItemMoveReqVo reqVo) {
        processChainItemService.move(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("删除工序链")
    @PostMapping("/delete")
    public BaseResVo delete(@RequestBody BaseIdReqVo reqVo){
        processChainItemService.delete(reqVo);
        return BaseResVo.ok();
    }
}
